<template>
  <!-- 全屏组件 -->
  <!-- 因为要布局所以要变成块 -->
  <div>
    <svg-icon
      icon-class="fullscreen"
      style="color:#fff; width: 20px; height: 20px"
      @click="changeScreen"
    />
  </div>
</template>

<script>
import ScreenFull from 'screenfull'
export default {
  methods: {
    changeScreen() {
      if (!ScreenFull.isEnabled) {
        // 此时全屏不可能
        this.$message.success('此时全屏组件不可用')
        return
      }
      ScreenFull.toggle()
    }
  }
}
</script>

<style>

</style>
